Skip to content

feat: #192 add severity levels that are not violations #409

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: gh-pages
Choose a base branch
from

Conversation

bergos
Copy link
Contributor

@bergos bergos commented Jun 22, 2025

This PR closes #192 "Add severity levels that are not violations". It contains the following changes:

  • Adds sh:Trace and sh:Debug severity levels that aren't violations.
  • Allows validation engines to treat sh:Info and sh:Warning as non-violating.
  • Changes the definition of sh:conforms of being true when there are no results to being true if there are no results with a severity level that is a violation.

A rule based on RDF classes for sh:conforms would have been preferred, but since it's possible to dynamically set sh:Info and sh:Warning being a violation, that is not possible.

Allowing validation engines to treat levels as non-violating but keeping the default makes this a non-breaking change.

@bergos bergos marked this pull request as ready for review June 22, 2025 16:32
Copy link
Contributor

@HolgerKnublauch HolgerKnublauch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good addition, and it's good to relax the interpretation of conforms. However, there are other places that now need to be changed too. A quick look revealed the section "Conformance Checking", which formally defines the term "conforms". This needs to take the additional flexibility into account. Other places that rely on "conforms" such as sh:node then don't need to be adjusted further.

@bergos
Copy link
Contributor Author

bergos commented Jun 24, 2025

@HolgerKnublauch I also rechecked the spec and found only the "Conformance Checking" section that needed an update. The change is included in the latest commit.

@bergos bergos requested a review from HolgerKnublauch June 24, 2025 07:00
@bergos
Copy link
Contributor Author

bergos commented Jul 12, 2025

@ajnelson-nist I've added the test cases for sh:Debug and sh:Trace, as discussed in our call.

Comment on lines +1763 to +1766
<p>
Validation engines MAY treat <code>sh:Info</code> and <code>sh:Warning</code> as non-violating based on
options passed to the engine. By default, they are treated as violations.
</p>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think my one last hangup on this PR is this escape and the lack of demonstration of a "test configuration record".

The tests @bergos added, 4 and 5, are fine demonstrations of a validation result set with conformance of true and the non-violation levels. (Thank you, Thomas.)

Can the test suite support a new test 6, mostly duplicative of 4 or 5, but instead using sh:Warning and a conformance of true? How would test suite conformance be reproducible?

I feel like another property in the ValidationReport would be helpful, that logs whether its sh:conformance value was set to "excuse" sh:Info or sh:Warning severity results from tripping sh:conformance into false. [] a sh:ValidationReport ; sh:excuses sh:Warning ; ...? sh:permits, sh:permitsSeverity, or sh:excusesSeverity might work too.

@ajnelson-nist ajnelson-nist mentioned this pull request Jul 15, 2025
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add severity levels that are not violations
4 participants